/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package BD;

import java.io.Serializable;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ARMGARCES
 */
@Entity
@Table(name = "catalogo_mp")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CatalogoMp.findAll", query = "SELECT c FROM CatalogoMp c"),
    @NamedQuery(name = "CatalogoMp.findByIdCatalogomp", query = "SELECT c FROM CatalogoMp c WHERE c.idCatalogomp = :idCatalogomp")})
public class CatalogoMp implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idCatalogo_mp")
    private Integer idCatalogomp;
    @JoinColumn(name = "fk_idMateriaPrima", referencedColumnName = "idMateriaPrima")
    @ManyToOne(optional = false)
    private Materiaprima fkidMateriaPrima;
    @JoinColumn(name = "fk_idProveedor", referencedColumnName = "idProveedor")
    @ManyToOne(optional = false)
    private Proveedor fkidProveedor;

    public CatalogoMp() {
    }

    public CatalogoMp(Integer idCatalogomp) {
        this.idCatalogomp = idCatalogomp;
    }

    public Integer getIdCatalogomp() {
        return idCatalogomp;
    }

    public void setIdCatalogomp(Integer idCatalogomp) {
        this.idCatalogomp = idCatalogomp;
    }

    public Materiaprima getFkidMateriaPrima() {
        return fkidMateriaPrima;
    }

    public void setFkidMateriaPrima(Materiaprima fkidMateriaPrima) {
        this.fkidMateriaPrima = fkidMateriaPrima;
    }

    public Proveedor getFkidProveedor() {
        return fkidProveedor;
    }

    public void setFkidProveedor(Proveedor fkidProveedor) {
        this.fkidProveedor = fkidProveedor;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCatalogomp != null ? idCatalogomp.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CatalogoMp)) {
            return false;
        }
        CatalogoMp other = (CatalogoMp) object;
        if ((this.idCatalogomp == null && other.idCatalogomp != null) || (this.idCatalogomp != null && !this.idCatalogomp.equals(other.idCatalogomp))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "BD.CatalogoMp[ idCatalogomp=" + idCatalogomp + " ]";
    }
    
}
